import logging.config


LOGGING_CONFIG = {
    "version": 1,
    "formatters": {
        "default": {
            'format': '%(asctime)s %(filename)s %(lineno)s %(levelname)s thread:%(thread)d %(message)s',
        }
    },
    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "level": logging.DEBUG,
            "formatter": "default",
        }
    },
    "loggers": {
        "console_logger": {
            "handlers": ["console"],
            "level": "DEBUG",
            "propagate": False,
        }
    },

    "disable_existing_loggers": True,
}

logging.config.dictConfig(LOGGING_CONFIG)

#指定使用哪个logger
logger = logging.getLogger("console_logger")


